package org.petstore.persistence;

import org.petstore.domain.Account;


public interface UserDAO {

    /**
     * description 用于登录
     *
     * @param username:
     * @param password:
     * @return Account
     * @author huangzhangyan
     * @date 2022/1/10 15:30
     */
    Account findUserByUsernameAndPassword(String username, String password);

    /**
     * description 查询单个用户的信息
     *
     * @param username:
     * @return Account
     * @author huangzhangyan
     * @date 2022/1/10 15:30
     */
    Account getUserInfoByUsername(String username);

    /**
     * description 新增用户
     *
     * @param user :
     * @author huangzhangyan
     * @date 2022/1/10 15:30
     */
    void addUser(Account user);

    /**
     * description 通过查询Username判断User是否存在
     *
     * @param username: 被查询的username
     * @return boolean 返回是否存在
     * @author huangzhangyan
     * @date 2021/11/1 1:10
     */
    boolean isUserExistByUsername(String username);

    /**
     * description 删除用户
     *
     * @param username :
     * @author huangzhangyan
     * @date 2022/1/10 15:30
     */
    void deleteUser(String username);
}
